<?
/*
application.class.php
author:wenbo
howtodesign@sina.com
wbedit@sina.com
2010.02.17
*/
require_once 'core/c.class.php';
class Application{
	var $title;
	var $id;
	function run(){
		require_once 'config/conn.php';
		$p=$_SERVER['QUERY_STRING'];
		$p=explode(',',$p);
		$c_mod=$p[0];
		if($c_mod==''){
			$c_mod='index';
		}
		require_once 'c/'.$c_mod.'.php';
		$c=new $c_mod;
		$f=$p[1];
		$count=count($p);
		if($count==2){
			$ptmp=0;
			foreach($_POST as $i){
				$k=key($_POST);
				next($_POST);
				$s.='$_POST["'.$k.'"]'.',';
				$ptmp++;
			}
			$s=substr($s,0,strlen($s)-1);
		}else{
			$tmp=0;
			foreach($p as $i){
				if($tmp>1){
					$s.=$i.',';
				}else{
					$tmp++;
				}
			}
			$s=substr($s,0,strlen($s)-1);
		}
		if($f==''){
			$f='def';	
		}
		@eval('$c->'.$f.'('.$s.');');
		$c->dpl($c_mod,$f);
	}
}